package com.jiwei.community.controller;

import com.jiwei.community.entity.Report;
import com.jiwei.community.service.ReportService;
import com.jiwei.community.utils.SecurityUtils;
import com.jiwei.community.vo.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 季伟
 * @date 2024/5/16 0:27
 * 功能：
 */
@RestController
@RequestMapping("/report")
public class ReportController {
    @Autowired
    ReportService reportService;
    @PostMapping
    ResponseResult addReport(@RequestBody Report report){
        Long userId = SecurityUtils.getUserId();
        return reportService.addReport(userId,report);
    }
}
